home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Math / CRandom.as next >
Text File  |  2011-08-19  |  2KB  |  104 lines

  1. package Local.Math
  2. {
  3.    public class CRandom
  4.    {
  5.       
  6.       private static const MULTIPLIER:uint = 16807;
  7.       
  8.       private static const dMODULUS:Number = 1 / 2147483647;
  9.       
  10.       private static const MODULUS:uint = 2147483647;
  11.        
  12.       
  13.       private var _Seed:uint;
  14.       
  15.       public function CRandom(param1:uint)
  16.       {
  17.          if(true)
  18.          {
  19.             super();
  20.             mSeed = param1;
  21.          }
  22.       }
  23.       
  24.       public function OffsetAndAdd(param1:Number, param2:Number) : Number
  25.       {
  26.          if(true)
  27.          {
  28.             ┬º┬ºpush(Offset(param1));
  29.             ┬º┬ºpush(Offset(param1));
  30.             if(true)
  31.             {
  32.                var _loc3_:* = ┬º┬ºpop();
  33.                if(true)
  34.                {
  35.                   param1 = ┬º┬ºpop();
  36.                   ┬º┬ºpush(_loc3_);
  37.                }
  38.                return ┬º┬ºpop() < 0 ? Number(param1 - param2) : Number(param1 + param2);
  39.             }
  40.             ┬º┬ºgoto(addr47);
  41.          }
  42.          ┬º┬ºgoto(addr33);
  43.       }
  44.       
  45.       public function Num() : Number
  46.       {
  47.          return mSeed * dMODULUS;
  48.       }
  49.       
  50.       public function SignOrZero() : int
  51.       {
  52.          return int(Num() * 3) - 1;
  53.       }
  54.       
  55.       public function UINT(param1:uint) : uint
  56.       {
  57.          return mSeed % param1;
  58.       }
  59.       
  60.       public function Offset(param1:Number) : Number
  61.       {
  62.          ┬º┬ºpush(Num());
  63.          if(true)
  64.          {
  65.             ┬º┬ºpush(┬º┬ºpop() * 2);
  66.             if(true)
  67.             {
  68.                ┬º┬ºpush(┬º┬ºpop() * param1);
  69.             }
  70.             ┬º┬ºpush(┬º┬ºpop() - param1);
  71.          }
  72.          return ┬º┬ºpop();
  73.       }
  74.       
  75.       public function set mSeed(param1:uint) : void
  76.       {
  77.          ┬º┬ºpush(┬º┬ºfindproperty(_Seed));
  78.          if(true)
  79.          {
  80.             ┬º┬ºpop()._Seed = !!param1 ? uint(param1) : uint(MODULUS - 1);
  81.             return;
  82.          }
  83.          ┬º┬ºgoto(addr14);
  84.       }
  85.       
  86.       public function Sign() : int
  87.       {
  88.          return int(Num() * 2) * 2 - 1;
  89.       }
  90.       
  91.       public function get mSeed() : uint
  92.       {
  93.          ┬º┬ºpush(┬º┬ºfindproperty(mSeed));
  94.          ┬º┬ºpush(_Seed * MULTIPLIER);
  95.          if(true)
  96.          {
  97.             ┬º┬ºpush(┬º┬ºpop() % MODULUS);
  98.          }
  99.          ┬º┬ºpop().mSeed = ┬º┬ºpop();
  100.          return _Seed;
  101.       }
  102.    }
  103. }
  104.